package main

import "go-leetcode/leetcode/utils"

func main() {

}

func isPalindrome(head *utils.ListNode) bool {
	// 辅助数组
	var arr []int

	for head != nil {
		arr = append(arr, head.Val)
		head = head.Next
	}

	arrLen := len(arr)

	for i := 0; i < arrLen/2; i++ {
		if arr[i] != arr[arrLen-i-1] {
			return false
		}
	}

	return true
}
